﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="Mobile System" />
    <title>系统主页</title>
    <link rel="stylesheet" href="../css/jquery.mobile-1.3.0.css" />
    <script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript" src="../js/jquery.mobile-1.3.0.js"></script>
    <script src="../js/Jquery.Common.js" type="text/javascript"></script>
    <script src="../js/Jquery.Global.js" type="text/javascript"></script>
    <script src="../js/Jquery.PageControl.js"></script>
    <script type="text/javascript">
        var strId;
        strRootPath = "../";
        $(document).ready(function () {
            var strMsg = GetCurrentDate();
            strId = request.QueryString("key");

            $('#mainTitle').html('【报销管理】    欢迎您，' + strUserid + "  " + strMsg);

            InitControls();

            //获取报销记录
            KqList();
        });

        function ReturnLogin() {
            window.location.href = "Login.html";
        }

        //初始化空间的值
        function InitControls() {
            $("#txtuserid").val(strUserid);
            $("#txtbxrq").val(strDqrq);

            if (strId != ""&& strId!=null) {
                var paramsInfo = "{'tabname':'ST_USER_BX','tabkeyname':'ID','tabkeyvalue':'" + strId + "'}";
                var nReturn = GetServerDataJson("Common.CommonPageOperation", "GetTableInfo", paramsInfo, "m", LoadCtrlsValue);
            }
        }

        //保存页面数据
        function SavePageData() {
            var paramsInfo = GetPageCtrls("kqdk", "ST_USER_BX", "id", strId); 
            var nReturn = GetServerDataJson("Common.CommonPageOperation", "SaveInfo", paramsInfo, "m", AlertInfo);
        }
        //获取报销记录
        function KqList() {
            var strParams = '{"strTable":"ST_USER_BX","strWhere":" userid=\'' + strUserid + '\'","strOrderBy":""}';
           
            GetServiceData("GetPubInfo", strParams, GetKqList, "ulNews");
            //$('#ulNews').listview('refresh');
        }

        //获取报销列表
        function GetKqList(strDivId, json) {
            json = json.toJson(); //格式化
            var strInner = "";
            for (var i = 0; i < json.length; i++) {
                o1 = json[i];
                strInner = strInner + '<li><a href="javascript:window.location.href=\'baoxiao.html?userid=' + strUserid+'&key='+ o1["id"].toString() + '\'">'+o1["bxrq"].toString()+'</a></li>';
            }

            $("#" + strDivId).html(strInner);
        }

        //提示消息
        function AlertInfo() {
            alert("保存成功");
        }
    </script>
</head>
<body>
    <div data-role="page" id="kqdk">
        <div data-role="panel" data-position-fixed="true" data-position="left" data-display="push" data-theme="b" id="nav-panel">
            <ul data-role="listview">
                <li data-icon="delete"><a href="#" data-rel="close">关闭</a></li>
                <li><a href="javascript:RedirectBySerial(1)">考勤</a></li>
                <li><a href="javascript:RedirectBySerial(3)">请假</a></li>
                <li><a href="javascript:RedirectBySerial(2)">报销</a></li>
            </ul>
        </div><!-- /panel -->

        <div data-role="header" data-position="fixed">
            <a href="#nav-panel" data-icon="bars" data-iconpos="notext">
                业务菜单
            </a>
            <h1 id="mainTitle">
                操作页面标题
            </h1>
            <a href="javascript:ExitSys()" data-role="button" data-icon="home">退出</a>
           
            <div data-role="navbar">
                <ul>
                    <li><a href="#kqdk" id="a1" data-icon="mail" class="ui-btn-active">报销申请</a></li>
                    <li><a href="#kqjl" id="a3" data-icon="grid">报销记录</a></li>
                </ul>
            </div>
            <!--/navbar -->
        </div>
        <!-- /header -->
        <div data-role="content">
            
            <div class="ui-field-contain">
                <label for="txtuserid">报销人:</label>
                <input id="txtuserid" name="txtuserid" type="text" value="" />
            </div>
            <div class="ui-field-contain">
                <label for="txtbxrq">报销时间:</label>
                <input id="txtbxrq" name="txtbxrq" type="date" value="" />
            </div>
            <div class="ui-field-contain">
                <label for="txtbxje">报销金额:</label>
                <input id="txtbxje" name="txtbxje" type="text" value="" />
            </div>
            <div class="ui-field-contain">
                <label for="txtbxmx">报销明细:</label>
                <textarea cols="40" rows="8" name="txtbxmx" id="txtbxmx"></textarea>
            </div>
        </div>
        <!-- /content -->
        <div data-role="footer" data-id="fool" data-position="fixed">
            <div data-role="controlgroup">
                <button class="ui-btn" id="btnLogin" name="btnLogin" onclick="SavePageData()">
                    保 存
                </button>
            </div>

        </div>
        <!-- /footer -->
    </div>
    <!-- /page -->

    <div data-role="page" id="kqjl">
        <div data-role="header" data-position="fixed">
            <a href="#nav-panel" data-icon="bars" data-iconpos="notext">
                业务菜单
            </a>
            <h1 id="h1Title">
                报销记录
            </h1>
            <div data-role="navbar">
                <ul>
                    <li><a href="#kqdk" id="a1" data-icon="grid" class="ui-btn-active">报销申请</a></li>
                    <li><a href="#kqjl" id="a3" data-icon="mail">报销记录</a></li>
                </ul>
            </div>
            <!--/navbar -->
        </div>
        <!-- /header -->
        <div data-role="content">
            <ul data-role="listview" style="margin-top: 0;" id="ulNews"></ul>
        </div>
        <!-- /content -->
    </div>

</body>
</html>
